package dota;

import java.awt.Canvas;

import gameframework.base.DrawableImage;

public class ImageManager {
	private ImageManager(Canvas canvas){
		image = new DrawableImage[6];
		for (int i = 0; i < 6; i++){
			image[i] = new DrawableImage(path[i],canvas);
		}
	}

	private static DrawableImage[] image;
	
	private static String[] path = { "images/wall.gif", "images/path.gif",
		"images/castle.gif", "images/hero1.gif", "images/soldier1.gif", "images/soldier2.gif"
	};
	private static int[] rendering_size_x = {16, 16, 32, 32, 16, 16};
	private static int[] rendering_size_y = {16, 16, 32, 38, 25, 25};
	private static String[][] spriteTypes = {{""}, {""}, {""}, {"right", "left", "up","down", "static"},
		{"down", "up", "left", "right", "static"}, {"down", "up", "left", "right", "static"}};
	
	public static int WALL = 0;
	public static int PATH = 1;
	public static int CASTLE = 2;
	public static int HERO1 = 3;
	public static int SOLDIER1 = 4;
	public static int SOLDIER2 = 5;
	
	public static ImageManager imManager;

	public static void loadImage(Canvas canvas){
		if (imManager==null){
			imManager = new ImageManager(canvas);
		}
		
	}
	
	public static DrawableImage getImage(int i){
		return image[i];
	}
	
	public static String getPath(int i) {
		return path[i];
	}
	
	public static int getSizeX(int i) {
		return rendering_size_x[i];
	}
	
	public static int getSizeY(int i) {
		return rendering_size_y[i];
	}
	
	public static String[] getSpriteTypes(int i) {
		return spriteTypes[i];
	}
}
